const { defineConfig } = require("@vue/cli-service");
const path = require("path");
module.exports = defineConfig({
  transpileDependencies: true,
  // 配置全局变量
  pluginOptions: {
    "style-resources-loader": {
      preProcessor: "less",
      patterns: [
        path.resolve(__dirname, "./src/assets/less/variables.less"), // 变量文件位置
      ],
    },
  },
  devServer: {
    port: 9999,
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        target: "http://hqx.test.ixunhang.com/api", //测试环境
        ws: true,
        changeOrigin: true,
        pathRewrite: {
          ["^" + process.env.VUE_APP_BASE_API]: "",
        },
      },
    },
  },
  outputDir: `../../html/main`,
  publicPath: "/",
  productionSourceMap: false,
});
